package cn.com.spotty.springdemo.services;

import cn.com.spotty.springdemo.bean.News;
import cn.com.spotty.springdemo.dao.NewsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class NewsService {
	@Autowired
	NewsMapper newsMapper;

	public List<News> getNews() {
		List<News> news = new ArrayList<>();
		try {
			news = newsMapper.getNews();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return news;
	}
}
